// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.characters;

import fmod.fmod.FMODManager;
import fmod.fmod.FMOD_STUDIO_PARAMETER_DESCRIPTION;
import zombie.core.math.PZMath;

public final class ZombieThumpManager extends BaseZombieSoundManager {
    public static final ZombieThumpManager instance = new ZombieThumpManager();

    public ZombieThumpManager() {
        super(40, 100);
    }

    @Override
    public void playSound(IsoZombie chr) {
        long _long = 0L;
        if (chr.thumpFlag == 1) {
            _long = chr.getEmitter().playSoundImpl("ZombieThumpGeneric", null);
        } else if (chr.thumpFlag == 2) {
            chr.getEmitter().playSoundImpl("ZombieThumpGeneric", null);
            _long = chr.getEmitter().playSoundImpl("ZombieThumpWindow", null);
        } else if (chr.thumpFlag == 3) {
            _long = chr.getEmitter().playSoundImpl("ZombieThumpWindow", null);
        } else if (chr.thumpFlag == 4) {
            _long = chr.getEmitter().playSoundImpl("ZombieThumpMetal", null);
        } else if (chr.thumpFlag == 5) {
            _long = chr.getEmitter().playSoundImpl("ZombieThumpGarageDoor", null);
        }

        FMOD_STUDIO_PARAMETER_DESCRIPTION fMOD_STUDIO_PARAMETER_DESCRIPTION = FMODManager.instance.getParameterDescription("ObjectCondition");
        chr.getEmitter().setParameterValue(_long, fMOD_STUDIO_PARAMETER_DESCRIPTION, PZMath.ceil(chr.getThumpCondition() * 100.0F));
    }

    @Override
    public void postUpdate() {
        for (int _int = 0; _int < this.characters.size(); _int++) {
            ((IsoZombie)this.characters.get(_int)).setThumpFlag(0);
        }
    }
}
